# Maintainer:

_pipname=argon2-cffi-bindings
pkgname=python-$_pipname
pkgver=21.2.0
pkgrel=4
pkgdesc='Low-level CFFI bindings for Argon2'
arch=(loong64 x86_64)
url='https://github.com/hynek/argon2-cffi-bindings'
license=(MIT)
depends=(python-cffi argon2)
makedepends=(python-build python-installer python-setuptools-scm python-wheel)
checkdepends=(python-pytest)
source=(https://pypi.io/packages/source/${_pipname:0:1}/$_pipname/$_pipname-$pkgver.tar.gz)
sha256sums=('bb89ceffa6c791807d1305ceb77dbfacc5aa499891d2c55661c6459651fc39e3')

build() {
  cd $_pipname-$pkgver
  ARGON2_CFFI_USE_SYSTEM=1 \
  python -m build --wheel --no-isolation
}

check() {
  cd $_pipname-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest
}

package() {
  cd $_pipname-$pkgver 
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
